<?php
include("activerecode.php");
class wdms_members extends ActiveRecode
{
	var $mno;
	var $id;
	var $passwd;
	var $name;
	var $nickname;
	var $email;
	var $phone;
	var $point;
	var $gisu;
	var $reg_date;
	var $birthday;
	var $photo;
	var $group;
	var $fields;
	var $fields_name_collection;
	function wdms_members($id = -1)
	{
 
		$this->mno = $id;
		$i = 0;
		$this->tablename = wdms_members;
		$datas = array();
		if($id > 0)
		{
			$this->fields_name_collection = array();
			$datas = $this->select_("mno", $id);

			$this->fields[mno] = $datas['mno'];
			$this->fields_name_collection[] = "mno";
			$this->fields[id] = $datas['id'];
			$this->fields_name_collection[] = "id";
			$this->fields[passwd] = $datas['passwd'];
			$this->fields_name_collection[] = "passwd";
			$this->fields[name] = $datas['name'];
			$this->fields_name_collection[] = "name";
			$this->fields[nickname] = $datas['nickname'];
			$this->fields_name_collection[] = "nickname";
			$this->fields[email] = $datas['email'];
			$this->fields_name_collection[] = "email";
			$this->fields[phone] = $datas['phone'];
			$this->fields_name_collection[] = "phone";
			$this->fields[point] = $datas['point'];
			$this->fields_name_collection[] = "point";
			$this->fields[gisu] = $datas['gisu'];
			$this->fields_name_collection[] = "gisu";
			$this->fields[reg_date] = $datas['reg_date'];
			$this->fields_name_collection[] = "reg_date";
			$this->fields[birthday] = $datas['birthday'];
			$this->fields_name_collection[] = "birthday";
			$this->fields[photo] = $datas['photo'];
			$this->fields_name_collection[] = "photo";
			$this->fields[group] = $datas['group'];
			$this->fields_name_collection[] = "group";

		}

	}

	function save()
	{

		//update
		$id = $this->fields[$this->fields_name_collection[0]];
		if($id > 0)
		{
			$this->update_($this->fields, $this->fields_name_collection[0]." = ".$id);
		}
		else	//insert
		{
			$this->insert_($this->fields);
		}
		
	}

	function destroy($id = -1)
	{

		if($id > 0)
		{
			$this->delete_($this->fields_name_collection[0]." = ".$id);
		}
		else
		{
			$id = $this->fields[$this->fields_name_collection[0]];
			$this->delete_($this->fields_name_collection[0]." = ".$id);
		}
		
	}

	function find_by_mno($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("mno", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_id($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("id", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_passwd($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("passwd", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_name($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("name", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_nickname($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("nickname", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_email($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("email", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_phone($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("phone", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_point($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("point", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_gisu($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("gisu", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_reg_date($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("reg_date", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_birthday($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("birthday", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_photo($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("photo", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

	function find_by_group($index)
	{

		$id = $this->fields[$this->fields_name_collection[0]];
		$datas = $this->select_("group", $index);
		$this->fields['mno'] = $datas['mno'];
		$this->fields['id'] = $datas['id'];
		$this->fields['passwd'] = $datas['passwd'];
		$this->fields['name'] = $datas['name'];
		$this->fields['nickname'] = $datas['nickname'];
		$this->fields['email'] = $datas['email'];
		$this->fields['phone'] = $datas['phone'];
		$this->fields['point'] = $datas['point'];
		$this->fields['gisu'] = $datas['gisu'];
		$this->fields['reg_date'] = $datas['reg_date'];
		$this->fields['birthday'] = $datas['birthday'];
		$this->fields['photo'] = $datas['photo'];
		$this->fields['group'] = $datas['group'];

	}

}

?>
